﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Teatime.Models.LogOnModel>" %>

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    <%: GlobalResources.Logon %>
</asp:Content>
<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <link href="<%: Url.Stylesheet("logon.css") %>" rel="stylesheet" type="text/css" />
    <div>
        <div class="wrapper">
            <%= Html.ActionLink("[English]", "ChangeCulture", "Home", new { lang = "en-us", returnUrl = this.Request.RawUrl }, null) %>
            <%= Html.ActionLink("[简体中文]", "ChangeCulture", "Home", new { lang = "zh-cn", returnUrl = this.Request.RawUrl }, null) %>
            <div id="login_form">
                <% if (GlobalResources.ResourceManager.GetString("_Language") == "English") // According to Culture to change Background Image
                   { %>
                <img src="<%: Url.Image("login_bg_eng.png") %>" id="login_bg" alt="Login Background" />
                <% }
                   else
                   { %>
                <img src="<%: Url.Image("login_bg.png") %>" id="login_bg" alt="Login Background" />
                <% } %>
                <% using (Html.BeginForm())
                   { %>
                <fieldset>
                    <p>
                        <label>
                            <%: GlobalResources.UserName %>:</label>
                        <%: Html.TextBoxFor(m => m.UserName) %>
                    </p>
                    <p>
                        <label>
                            <%: GlobalResources.Password %>:</label>
                        <%: Html.PasswordFor(m => m.Password) %>
                    </p>
                    <% if (GlobalResources.ResourceManager.GetString("_Language") == "English") // According to Culture to change Button Image
                       { %>
                    <input type="image" src="<%: Url.Image("logon_button_eng.png") %>" value="logon" />
                    <% }
                       else
                       { %>
                    <input type="image" src="<%: Url.Image("logon_button.png") %>" value="logon" />
                    <% } %>
                </fieldset>
                <div class="forgot-psw">
                    <a href="#">
                        <%: GlobalResources.ForgetPassword %></a>
                </div>
                <% } %>
                <div id="global_errors">
                    <p>
                        <% if (Html.ValidationSummary(false) != null)
                           { %>
                        <%: GlobalResources.LoginError%>
                        <% } %>
                    </p>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
